/**
 * 消费习惯管理初始化
 */
var ReservationsUpdateLog = {
    id: "ReservationsUpdateLogTable",	//表格id
    seItem: null,		//选中的条目
    table: null,
    layerIndex: -1
};

/**
 * 初始化表格的列
 */
ReservationsUpdateLog.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '', field: 'id', visible: false, align: 'center', valign: 'middle', width: '50px'},
        {title: '修改人', field: 'updatePeople', align: 'center', valign: 'middle', sortable: true},
        {
            title: '修改时间', field: 'updateTime', align: 'center', valign: 'middle', sortable: true,
            formatter: function (value, row, index) {
                return value.substring(0, 19);
            }
        },
        {title: '修改患者姓名', field: 'updateCname', align: 'center', valign: 'middle', sortable: true},
        {title: '修改患者电话', field: 'updateCphone', align: 'center', valign: 'middle', sortable: true},
        {title: '建档人', field: 'archiving', align: 'center', valign: 'middle', sortable: true},
        {
            title: '建档时间', field: 'filingTime', align: 'center', valign: 'middle', sortable: true,
            formatter: function (value, row, index) {
                return value.substring(0, 19);
            }
        },
    ];
};

/**
 * 查询表单提交参数对象
 * @returns {{}}
 */
ReservationsUpdateLog.formParams = function () {
    var queryData = {};
    queryData['archiving'] = $("#archiving").val();
    queryData['startTime'] = $("#startTime").val();
    queryData['endTime'] = $("#endTime").val();
    return queryData;
}

ReservationsUpdateLog.resetSearch = function () {
    $("#archiving").val("");
    $("#startTime").val("");
    $("#endTime").val("");
    ReservationsUpdateLog.search();
};

/**
 * 查询列表
 */
ReservationsUpdateLog.search = function () {
    ReservationsUpdateLog.table.refresh({query: ReservationsUpdateLog.formParams()});
};

$(function () {
    var defaultColunms = ReservationsUpdateLog.initColumn();
    var table = new BSTable(ReservationsUpdateLog.id, "/reservationsLog/updateList", defaultColunms);
    table.setPaginationType("server");
    table.setQueryParams(ReservationsUpdateLog.formParams());
    ReservationsUpdateLog.table = table.init();
    ReservationsUpdateLog.table = table;
});
